import { defineStore } from 'pinia'

// 创建实例对象
export const userCourrentStore = defineStore('counter', {
  state: () => {
    return {
      count: 2022
    }
  },

  actions: {
    changeValue(value) {
      this.count += value;
    }
  },

  //   changeValue() {
  //     this.count++;
  //   }
  // },

  getters: {
    evenOrOdd() {
      return this.count % 2 == 0 ? '偶数' : '奇数'
    }
  }
})